import java.util.Scanner;

public class tow {

	public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	while(in.hasNextInt()){
	int a=in.nextInt(),i=0,j=0;
	int c[]=new int[10];
	int sum = 0;
	int k = 0;
	if(a>=10000&&a<=20000){
		System.out.print(Integer.toBinaryString(a)+",");
		System.out.print(Integer.toOctalString(a)+",");
		System.out.println(Integer.toHexString(a));
	}
	else {
		a=Math.abs(a);
		for( i=0;a!=0;){
			k = a%10;
			c[i] = k;
			a/= 10;
			sum+=k;
			i++;
		}
		for( j = i-1;j>=0;j--) 
			System.out.print(c[j]+" ");
		System.out.println(sum);

	     }
	}  
	}
}

